package images

// DotSet 点集合.
type DotSet map[int64]struct{}

func key(x, y int) int64 {
	return int64(x)<<32 + int64(y)
}

// Add 增加.
func (d DotSet) Add(x, y int) {
	d[key(x, y)] = struct{}{}
}

// Has 包含.
func (d DotSet) Has(x, y int) (h bool) {
	_, h = d[key(x, y)]

	return
}
